//
//  GSRootTableViewCell.m
//  GameSky
//
//  Created by lanou on 16/1/20.
//  Copyright © 2016年 NiRongfei. All rights reserved.
//

#import "GSRootTableViewCell.h"

#define kmargin 10

@implementation GSRootTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        // 夜间模式
        self.dk_backgroundColorPicker = DKColorWithRGB(0xffffff, 0x343434);
        
        [self setUp];
    }
    return self;
}

- (void)setUp
{
    self.leftImage = [[UIImageView alloc]init];
    [self.contentView addSubview:self.leftImage];
    
    self.title = [[UILabel alloc]init];
    self.title.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor grayColor]);
    [self.contentView addSubview:self.title];
    
    self.rightBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    self.rightBtn.userInteractionEnabled = NO;
    [self.contentView addSubview:self.rightBtn];
    
    self.leftImage.sd_layout
    .leftSpaceToView(self.contentView, kmargin)
    .topSpaceToView (self.contentView, kmargin)
    .widthIs(30)
    .heightEqualToWidth();
    
    self.title.sd_layout
    .leftSpaceToView(self.leftImage, kmargin)
    .topEqualToView(self.leftImage)
    .widthIs(200)
    .heightIs(30);
    
    self.rightBtn.sd_layout
    .topEqualToView(self.title)
    .rightSpaceToView(self.contentView, kmargin)
    .heightIs(25)
    .widthIs (50);
    
    [self setupAutoHeightWithBottomView:self.rightBtn bottomMargin:0];
}

@end
